#include <iostream>
#include <iomanip>
#ifndef __ZHU_DATE__H
#define __ZHU_DATE__H
using namespace std;
bool is_leapyear(int y);
class Date
{

    class Bad_date {};
    
    static int n_days(int m, int y){
        return m != Feb ? _days[m-1]:(is_leapyear(y) ? 29: 28);
    }
    static int const _days[12];
    int _day,_month,_year;
    friend ostream& operator << (ostream& os, const Date& date);
    friend istream& operator >> (istream& is, Date& date);
    static Date default_date;
    
public:
    enum Month{Jan = 1, Feb, Mar, Apr, May, Jun,Jul, Aug, Sep, Oct, Nov, Dec};
    Date::Date(int dd = 0, Month mm =Month(0), int yy =0);
    int year()const;
    int day()const;
    int month()const;
    void add_year();
    void add_month();
    void add_day();
};

ostream& operator << (ostream& os, const Date& date);
istream& operator >> (istream& is, Date& date);
#endif

